/*
 Fading
 
 This example shows how to fade an LED using the analogWrite() function.
 
 The circuit:
 * LED attached from digital pin 9 to ground.
 
 Created 1 Nov 2008
 By David A. Mellis
 Modified 17 June 2009
 By Tom Igoe
 
 http://arduino.cc/en/Tutorial/Fading
 
 */

int sensorPin = 0;
long previousTick = 0;
long currentTick = 0;
long interval = 200;
int sensorValue = 0;


void setup()  { 
  Serial.begin(9600);
} 

void loop()  { 
  currentTick = millis();  
  if (currentTick - previousTick > interval) {
    previousTick = currentTick;
    fireEvent();
  }
}

void fireEvent() {
  sensorValue = analogRead(sensorPin);
  Serial.println(sensorValue);
}

